# MongoDB

FROM            10.0.16.125:5080/general/ubuntu:16.04
MAINTAINER      Lijc lijc@siccs.cn
# add mongodb repo
RUN             apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 
ADD             mongodb-org-3.4.list /etc/apt/sources.list.d/
# install deb
RUN             apt-get update && apt-get -y install mongodb-org
# modify config file
RUN             sed -i 's/127.0.0.1/0.0.0.0/' /etc/mongod.conf
# create persistent volume directory
RUN             mkdir /opt/pv
RUN             cd /opt/pv && mkdir -p mongodb_data mongodb_log
RUN             rm -rf /var/lib/mongodb /var/log/mongodb
RUN             ln -s /opt/pv/mongodb_data /var/lib/mongodb
RUN             ln -s /opt/pv/mongodb_log /var/log/mongodb
# import docker entry script
ADD             docker-entrypoint /opt/
RUN             chmod 0755 /opt/docker-entrypoint
EXPOSE          27017
CMD             /opt/docker-entrypoint

